package java19_11_18;

import java.util.Scanner;

//阶乘
public class Num1 {
    public static void main(String[] args) {
        Scanner s = new Scanner(System.in);
        int n = s.nextInt();
        int sum = 0;
        for (int i = 1; i <= n; i++) {
            int num = 1;
            for (int j = 1; j <= i; j++) {
                num *= j;
            }
            sum += num;
        }
        System.out.println(sum);
    }
}
